<?php

namespace app\payment\validate;

use think\Validate;

/**
 * 支付测试验证器
 */
class Test extends Validate
{

    // 定义验证规则
    protected $rule = [
        'manual|手动开关' => '',
        'type|支付类型' => '',
        'company|支付公司名称' => '',
        'child|选择支付公司下的子商户号名称' => '',
        'merchant_id|商户号' => '',
        'app_id|应用ID' => '',
        'key|密钥' => '',
        'cash|金额' => 'require|float|egt:0.01',
        'order_id|平台订单号' => '',
        'other_order_id|第三方订单号' => '',
    ];
    // 定义验证提示
    protected $message = [];
    // 定义场景，供快捷编辑时验证
    // protected $scene = [
    //     'manual' => ['manual' => 'require', 'type' => 'require', 'company' => 'require', 'merchant_id' => 'require', 'app_id' => 'require', 'key' => 'require'],
    //     'auto' => ['manual' => 'require', 'type' => 'require', 'company' => 'require', 'child' => 'require'],
    //     'queryok' => ['manual' => 'require', 'company' => 'require', 'other_order_id' => 'require'],
    //     'queryno' => ['manual' => 'require', 'order_id' => 'require',],
    // ];

    // 验证场景定义
    public function sceneManual()
    {
        return $this->only(['']);
    }

    // 验证场景定义
    public function sceneAuto()
    {
        return $this->only(['']);
    }

    // 验证场景定义
    public function sceneQueryok()
    {
        return $this->only(['']);
    }

    // 验证场景定义
    public function sceneQueryno()
    {
        return $this->only(['']);
    }
}
